home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / sun3.md / stdarg.h.old < prev    next >
Encoding:
Text File  |  1989-01-28  |  1.1 KB  |  39 lines

  1. /*
  2.  * stdarg.h --
  3.  *
  4.  *    Macros for handling variable-length argument lists.
  5.  *
  6.  * Copyright 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/lib/include/sun3.md/RCS/stdarg.h,v 1.2 88/11/15 21:41:23 rab Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _STDARG
  19. #define _STDARG
  20.  
  21. typedef struct {
  22.     char *vl_current;            /* Pointer to last arg returned from
  23.                      * list. */
  24.     char *vl_next;            /* Pointer to next arg to return. */
  25. } va_list;
  26.  
  27.  
  28. #define va_start(list, lastarg) \
  29.     (list).vl_current = (list).vl_next = ((char *) &lastarg) + 4;
  30.  
  31. #define va_arg(list, type)            \
  32.     ((list).vl_current = (list).vl_next,    \
  33.     (list).vl_next += sizeof(type),        \
  34.      *((type *) (list).vl_current))
  35.  
  36. #define va_end(list)
  37.  
  38. #endif /* _STDARG */
  39.